import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class TestMatcher {
	public static final String PATTERN_SOUFUN_RENT = "http://rent.soufun.com/(newcz|czagt|rent/searchmore)/[\\w=-]*.htm";
	public static final String PATTERN_A_HREF = "<a[^>]*href=\\s*\"([^\"]*)\"[^>]*>";
	//public static final String PATTERN_A_HREF = "<a\\s+href\\s*=\\s*(\"([^\"]*)\"|[^\\s>])\\s*>";
	
	public static void main(String[] args)
	{
		
		/*String content = "";
		Pattern pattern = Pattern.compile(PATTERN_A_HREF,
				Pattern.CASE_INSENSITIVE);
		Matcher matcher = pattern.matcher(content);*/
		//String url = "http://rent.soufun.com/rent/searchmore/bs-AGTCZ__address_hs-AGTHOUSE__cm-__-1_0_0_0_0__0_od-_ds-_rm-0_hl--1_pz-30_mp=1_0_0_0.htm";
		//String url = "http://rent.soufun.com/czagt/106100_1.htm";
		String url = "<a id=\"ded\" href=\"/czagt/91635_1.htm\" target=_blank class=\"ctw\">";
		if (url.matches(PATTERN_A_HREF))
		{
			System.out.println("a href");
		}
		else
		{
			System.out.println("not a href");
		}
		if (url.matches(PATTERN_SOUFUN_RENT))
		{
			System.out.println("a soufun link");
		}
		else
		{
			System.out.println("not a soufun link");
		}
	}
}
